<script setup lang='ts'>
const props = defineProps({
  fileList: {
    type: Array,
    required: true,
    default: () => []
  },
  oneImgSize: {
    type: Number,
    default: 10 * 1024 * 1024 // 5M
  },
  maxCount: {
    type: Number,
    default: 20
  },
  afterRead: {
    type: Function,
    required: true
  },
  deletePic: {
    type: Function,
    required: true
  }
})


function handleOverSize() {
  uni.showToast({
    title: `每张图片的大小为${props.oneImgSize}M`,
  })
}

</script>

<template>
  <view class='journal-album__container class="mt-40"'>
    <uv-upload @oversize="handleOverSize" :fileList="fileList" multiple :maxSize="oneImgSize" :maxCount="20"
      @afterRead="afterRead" @delete="deletePic"></uv-upload>
  </view>
</template>

<style scoped lang='scss'></style>